#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QApplication, QWidget, QDial, QLabel, QHBoxLayout
 
 
class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()


    def initUI(self):

        self.dial = QDial(self)
        self.dial.setFixedSize(200, 200)    #设置尺寸      
        self.dial.setRange(0, 100)          #设置数值范围 
        self.dial.setNotchesVisible(True) 
        self.dial.valueChanged.connect(self.on_change_func)  

        self.label = QLabel('0', self)
        self.label.setFont(QFont('Arial Black', 50)) #设置字体

        self.h_layout = QHBoxLayout()
        self.h_layout.addStretch(1)
        self.h_layout.addWidget(self.dial)
        self.h_layout.addStretch(1)
        self.h_layout.addWidget(self.label)
        self.h_layout.addStretch(1)

        self.setLayout(self.h_layout)

        self.setGeometry(300, 300, 500, 300)
        self.setWindowTitle('Dial Label')    
        self.show()

    def on_change_func(self):
        self.label.setText(str(self.dial.value()))

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())

